#ifndef _GRATE_SIMPLE_H_
#define _GRATE_SIMPLE_H_

#include "dfa.h"
#include "input_data.h"
#include "grate_config.h"

// Returns number of vertices in scc or (-1) if there is more than one scc
int tarjan_find_scc_dumb(dfa * DFA, const input_data & INPUT, char * nxt_used);

// Returns the number of vertex in cycle, assuming there is always one scc
int calc_vert_incycle(dfa * DFA, const input_data & INPUT, char * nxt_used);

// Finds a single scc in a graph, that contains vert_incycle
void tarjan_find_scc_improved(dfa * DFA, const input_data & INPUT, const int vert_incycle, char * nxt_used);

double calc_grate_simple(dfa * DFA, const input_data & INPUT, const grate_config & CONFIG);

// Returns grate of scc listed in the array, also sets the values of scc_size and scc_edgnum of this scc
double calc_grate_for_scc (dfa * DFA, const input_data & INPUT, const grate_config & CONFIG, int * scc, int & scc_size, int & scc_edgnum);

#endif